package com.shiyanlou.file.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shiyanlou.file.model.UserFile;

import java.util.List;
import com.shiyanlou.file.vo.UserfileListVO;
import org.apache.ibatis.annotations.Param;

//实验8修改：继承BaseMapper，方便之后使用 MyBatis-Plus 来操作数据库
public interface UserfileMapper extends BaseMapper<UserFile> {

    //新增文件查询接口
    List<UserfileListVO> userfileList(UserFile userfile, Long beginCount, Long pageCount);

    //实验8代码
    List<UserfileListVO> selectFileByExtendName(List<String> fileNameList, Long beginCount, Long pageCount, long userId);

    Long selectCountByExtendName(List<String> fileNameList, Long beginCount, Long pageCount, long userId);

    List<UserfileListVO> selectFileNotInExtendNames(List<String> fileNameList, Long beginCount, Long pageCount, long userId);

    Long selectCountNotInExtendNames(List<String> fileNameList, Long beginCount, Long pageCount, long userId);

    //新增文件移动接口
    void updateFilepathByFilepath(String oldfilePath, String newfilePath, Long userId);


    void replaceFilePath(@Param("filePath") String filePath, @Param("oldFilePath") String oldFilePath, @Param("userId") Long userId);
    Long selectStorageSizeByUserId(@Param("userId") Long userId);
}